import { createApp } from 'vue'
import { createPinia } from 'pinia'
import { createRouter, createWebHistory } from 'vue-router'
import { Button, NavBar, Cell, CellGroup, Field, Form, List, PullRefresh, Tabbar, TabbarItem, Dialog, Toast, Search, Pagination, DatetimePicker, Popup, Uploader, Icon } from 'vant'
import 'vant/lib/index.css'

import App from './App.vue'
import routes from './router'

const app = createApp(App)
const pinia = createPinia()
const router = createRouter({
  history: createWebHistory(),
  routes
})

// 注册Vant组件
app.use(Button)
app.use(NavBar)
app.use(Cell)
app.use(CellGroup)
app.use(Field)
app.use(Form)
app.use(List)
app.use(PullRefresh)
app.use(Tabbar)
app.use(TabbarItem)
app.use(Dialog)
app.use(Toast)
app.use(Search)
app.use(Pagination)
app.use(DatetimePicker)
app.use(Popup)
app.use(Uploader)
app.use(Icon)

app.use(pinia)
app.use(router)

app.mount('#app')
